package top.dszy.test.debugger;


import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import top.dszy.test.debugger.model.City;
import top.dszy.test.debugger.model.User;

import java.io.InputStream;

public class App {
    public static void main(String[] args) throws Exception {
        InputStream inputStream = Resources.getResourceAsStream("mybatis.xml");
        SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream);
        SqlSession sqlSession = sqlSessionFactory.openSession();
        City city = sqlSession.selectOne("top.dszy.test.debugger.dao.CityDao.getById", 1);
//        City user = sqlSession.selectOne("top.dszy.test.debugger.dao.CityDao.getUserById", 1);
        System.out.println(city);
        System.out.println(city.getName());
    }

}
